<html>
<head>
	<link href="<?php echo _get_cfg_path('admin_css')?>base.css" rel="stylesheet" type="text/css" />
	<link href="<?php echo _get_cfg_path('admin_css')?>common.css" rel="stylesheet" type="text/css" />
	<link href="<?php echo _get_cfg_path('admin_css')?>main.css" rel="stylesheet">
    <link href="<?php echo _get_cfg_path('admin_css')?>right.css" rel="stylesheet">

</head>
<body>
<div class="right_con common">
	<h1>资讯管理</h1>
	<table cellpadding="0" cellspacing="0" bordercolor="#eee" border="0" width="100%">
		<tr>
            <td height="32">
                <form class="form-horizontal" role="form" method="post">
                    <label>标题</label>
                    <input type="text" name="title" value="<?=!empty($arrParam['title']) ? $arrParam['title']:'';?>" class="w150">
                    &nbsp;&nbsp;
                    <label>开始时间</label>
                    <input type="text" name="begtime" class="w100" value="<?php if( !empty($arrParam['begtime']) ) echo $arrParam['begtime']; ?>"  readonly="readonly" onclick="WdatePicker()" placeholder="请选择日期">
                    &nbsp;&nbsp;
                    <label> ~ </label>
                    <input type="text" name="endtime" class="w100" value="<?php if( !empty($arrParam['endtime']) ) echo $arrParam['endtime']; ?>" readonly="readonly" onclick="WdatePicker()" placeholder="请选择日期">
                    &nbsp;&nbsp;
                    <label>标签</label>
                    <input type="text" name="tag" value="<?=!empty($arrParam['tag']) ? $arrParam['tag']:'';?>" class="w150">
                    &nbsp;&nbsp;
                    <label>类型</label>
                    <select name="type">
                        <option value="0">请选择</option>
                        <option value="1" <?php if ($arrParam['type']&&$arrParam['type']==1):?>selected="selected"<?php endif;?>>时尚资讯</option>
                        <option value="2" <?php if ($arrParam['type']&&$arrParam['type']==2):?>selected="selected"<?php endif;?>>摄影基地</option>
                    </select>
                    <button type="submit" class="btn">查  询</button>
                 </form>
            </td>
            <td><a href='/admin/advisory/add' class="sub">添加</a></td>
        </tr>
    </table>
	<table cellpadding="0" cellspacing="0" align="center" bordercolor="#eee" border="1" width="100%" class="listTab">
		<tbody>
			<tr height="39" style="font-size:13px;">
	            <td width="20%" height="25">资讯标题</td>
	            <td width="5%">标签/城市</td>
	            <td width="5%">类型</td>
	            <td width="10%">资讯日期</td>
	            <td width="15%">图片地址</td>  
	            <td width="5%">推荐</td>         
	            <td width="5%">最后操作人</td>
	            <td width="15%">操作</td>
	        </tr>
	        <?php foreach ($list['rows'] as $key => $a): ?>
			<tr>
				<td height="30"><?php echo $a['title'];?></td>
				<td><?=$a['tag']?></td>
				<td><?php if ($a['type']==1) echo '时尚资讯';elseif ($a['type'] == 2) echo '摄影基地';?></td>
				<td><?=date('Y-m-d',$a['advisory_date'])?></td>
				<td><img src="<?php echo _getOssPath($a['advisory_img']);?>" width="150"></td>
				<td><?=$a['is_recommend']?'推荐':''?></td>
				<td><?php echo $a['op_username'];?></td>
				<td class="con_title">
				    <a href="/admin/advisory/recommend?id=<?php echo _get_key_val($a['id']);?>&page=<?php echo _get_page()?>"><?php if(!$a['is_recommend']) echo '推荐';else echo '不推荐';?></a>
					<a href="/admin/advisory/add?id=<?php echo _get_key_val($a['id']);?>">修改</a>
					<a href="javascript:void(0)" onclick="delete_advisory(<?php echo _get_key_val($a['id']);?>)">删除</a>
				</td>
			</tr>
			<?php endforeach;?>
			
	    </tbody>
	</table>
	<table cellpadding="0" cellspacing="0" bordercolor="#eee" border="0" width="100%">
		<tr>
            <td colspan="2" height="32" align="right">
                <div class="page">
                	<?=$list['pages']?>
                </div>
            </td>
        </tr>
    </table>
</div>
<script type="text/javascript" src="<?php echo _get_cfg_path('lib')?>My97DatePicker/WdatePicker.js"></script>
<script>
function delete_advisory(id)
{
	if(confirm("确定要删除数据吗"))
	{
		window.location.href='/admin/advisory/del?id='+id;
	}
}
</script>
<?php include_once(VIEWPATH."admin/publish/main_footer.php");?>
</body>
</html>